package com.gperp.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gperp.common.ContactsCustomsKeywordsResult;
import com.gperp.common.GPResult;
import com.gperp.common.PortalCondition;
import com.gperp.pojo.Result;
import com.gperp.service.PortalService;
@Controller
public class PortalController {
	@Resource
	private PortalService portalService;
	//包含分页，模糊查询	
	@RequestMapping(value="selectlikeas_keywordsPage",method=RequestMethod.POST)
	@CrossOrigin
	@ResponseBody
	public Result getlikePortalList(Integer page,Integer rows,PortalCondition condition){
		//调用服务查询商品列表
		Result list=portalService.getlikePortal(page, rows, condition);
		return list;
	}
	//查看门户详情
	@RequestMapping(value="queryPortalByID",method=RequestMethod.GET)
	@CrossOrigin
	@ResponseBody
	public ContactsCustomsKeywordsResult queryPortalByID(Long id){
		return portalService.getContactsCustomsKeywordsResult(id);
	}
	//修改门户详情
	@RequestMapping(value="updateportal",method=RequestMethod.POST)
	@CrossOrigin
	@ResponseBody
	public GPResult updateportal(Long id,String appusername,String apppassword,String iosdownloadurl,String codeiosurl,String androiddownloadurl,String codeandroidurl){
		return portalService.updateportal(id, appusername, apppassword, iosdownloadurl, codeiosurl, androiddownloadurl, codeandroidurl);
				
	}
}
